

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style type="text/css">
 
  </style>
</head>
<body>
  <div id="app">
    <div>{{msg}}</div>
    <!-- 字符串反转 -->
    <div>{{reverseString}}</div>
  </div>

  <script type="text/javascript" src="./js/vue.js"></script>
  <script type="text/javascript">
    /*
      计算属性
    */
    var vm = new Vue({
      el: '#app',
      data: {
       msg:"lvchengxin" 
      },
      computed: {
        // 下面是具体的业务逻辑 方法名 reverseString
        reverseString() {
          return this.msg.split('').reverse().join('');
        }
      }
    });
  </script>
</body>
</html>
